package com.waitingresult.datastruct.bubbling;


import java.util.Arrays;

/**
 * @Author: WangShuai
 * @CreateTime: 2024-12-15  14:46
 * @Description:
 * @Version: 1.0
 */
public class Bubbling {
    public static void main(String[] args) {
        int[] arr = {8, 3, 4, 51, 2, 23, 656, 787, 1000, 777};
        sort(arr);
        System.err.println(Arrays.toString(arr));
    }

    private static void sort(int[] arr) {
        forall:
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length; j++) {
                boolean flag = false;
                if (arr[i] < arr[j]) {
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                    flag = true;
                }
                if (!flag) {
                    continue forall;
                }
            }
        }
    }

    public static void swap(int[] arr, int i, int j) {

    }
}
